//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.Diagnostics.CodeAnalysis;
using System.Management.Instrumentation;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability;

namespace EntLibContrib.Resource.Configuration.Manageability
{
	/// <summary>
	/// Represents the configuration information from a 
	/// <see cref="EntLibContrib.Resource.Configuration.CustomResourceProviderData"/> instance.
	/// </summary>
	/// <seealso cref="EntLibContrib.Resource.Configuration.CustomResourceProviderData"/>
	/// <seealso cref="ResourceProviderSetting"/>
	[InstrumentationClass(InstrumentationType.Instance)]
	public class CustomResourceProviderSetting : ResourceProviderSetting
	{
		#region Fields
		private String providerType;
		private String[] attributes;
		#endregion

		#region Properties
		/// <summary>
		/// Gets the name of the type for the custom resource provider for the represented configuration object.
		/// </summary>
		/// <seealso cref="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.NameTypeConfigurationElement.Type">Inherited NameTypeConfigurationElement.Type</seealso>
		public String ProviderType
		{
			get { return providerType; }
			internal set { providerType = value; }
		}

		/// <summary>
		/// Gets the collection of attributes for the custom exception handler represented as a 
		/// <see cref="String"/> array of key/value pairs for the represented configuration object.
		/// </summary>
		/// <seealso cref="EntLibContrib.Resource.Configuration.CustomResourceProviderData.Attributes">CustomResourceProviderData.Attributes</seealso>
		[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
		public String[] Attributes
		{
			get { return attributes; }
			internal set { attributes = value; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="CustomResourceProviderSetting"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="resourceBaseName">Name of the resource base.</param>
		/// <param name="providerType">Type of the provider.</param>
		/// <param name="attributes">The attributes.</param>
		internal CustomResourceProviderSetting(String name, String resourceBaseName, String providerType, String[] attributes)
			: base(name, resourceBaseName)
		{
			this.providerType = providerType;
			this.attributes = attributes;
		}
		#endregion
	}
}
